package ad

import (
	"yunj/app/service/admin/adservice"
	"yunj/pkg/yunj/app/controller/admin"

	"github.com/gin-gonic/gin"
)

type Ad struct {
	admin.Controller
}

// 列表
func (ctrl *Ad) List(ctx *gin.Context) {
	ctrl.RenderTable(ctx, adservice.AdPage.ListBuilder(ctx))
}

// 添加
func (ctrl *Ad) Add(ctx *gin.Context) {
	ctrl.RenderForm(ctx, adservice.AdPage.FormBuilder(ctx, false))
}

// 编辑
func (ctrl *Ad) Edit(ctx *gin.Context) {
	ctrl.RenderForm(ctx, adservice.AdPage.FormBuilder(ctx, true))
}
